if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_ISO_UpdateGiaoAnLyThuyet]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_ISO_UpdateGiaoAnLyThuyet]
GO
CREATE PROCEDURE sp_ISO_UpdateGiaoAnLyThuyet
	@stt int output,
	@MaGiaoAn int,
	@MA_KHGD int,
	@So_giao_an int,
	@Ngay_thuc_hien datetime,
	@Muc_tieu nvarchar(2000),
	@Do_dung_PT_DH nvarchar(2000),
	@On_dinh_LH nvarchar(2000),
	@Thoi_gian_on_dinh int,
	@Thoi_gian_TH_BH int,
	@Dan_nhap nvarchar(2000),
	@HD_dan_nhap_GV nvarchar(2000),
	@HD_dan_nhap_HS nvarchar(2000),
	@Thoi_gian_dan_nhap int,
	@Noi_dung_bai_giang nvarchar(4000),
	@HD_giang_bai_moi_GV nvarchar(2000),
	@HD_giang_bai_moi_HS nvarchar(2000),
	@Thoi_gian_bai_giang int,
	@Cung_co_kien_thuc nvarchar(2000),
	@HD_cung_co_GV nvarchar(2000),
	@HD_cung_co_HS nvarchar(2000),
	@Thoi_gian_cung_co int, 
	@Huong_dan_tu_hoc nvarchar(40),
	@HD_HDTH_GV nvarchar(2000),
	@HD_HDTH_HS nvarchar(2000),
	@Thoi_gian_HDTH int,
	@Tai_lieu_tham_khao nvarchar(40),
	@Ngay_cap_nhat_cuoi datetime
AS
BEGIN
	UPDATE GIAOAN
		SET MA_KHGD=@MA_KHGD,
		So_giao_an=@So_giao_an,
		Ngay_thuc_hien=@Ngay_thuc_hien,
		Muc_tieu=@Muc_tieu,
		Do_dung_PT_DH=@Do_dung_PT_DH,
		On_dinh_LH=@On_dinh_LH,
		Thoi_gian_on_dinh=@Thoi_gian_on_dinh,
		Thoi_gian_TH_BH=@Thoi_gian_TH_BH,
		Dan_nhap=@Dan_nhap,
		HD_dan_nhap_GV=@HD_dan_nhap_GV,
		HD_dan_nhap_HS=@HD_dan_nhap_HS,
		Thoi_gian_dan_nhap=@Thoi_gian_dan_nhap,
		Noi_dung_bai_giang=@Noi_dung_bai_giang,
		HD_giang_bai_moi_GV=@HD_giang_bai_moi_GV,
		HD_giang_bai_moi_HS=@HD_giang_bai_moi_HS,
		Thoi_gian_bai_giang=@Thoi_gian_bai_giang,
		Cung_co_kien_thuc=@Cung_co_kien_thuc,
		HD_cung_co_GV=@HD_cung_co_GV,
		HD_cung_co_HS=@HD_cung_co_HS,
		Thoi_gian_cung_co=@Thoi_gian_cung_co,
		Huong_dan_tu_hoc=@Huong_dan_tu_hoc,
		HD_HDTH_GV=@HD_HDTH_GV,
		HD_HDTH_HS=@HD_HDTH_HS,
		Thoi_gian_HDTH=@Thoi_gian_HDTH,
		Tai_lieu_tham_khao=@Tai_lieu_tham_khao,
		Ngay_cap_nhat_cuoi=@Ngay_cap_nhat_cuoi,
		Tinh_trang=0
	WHERE ID=@MaGiaoAn
END
